﻿using System.ComponentModel.DataAnnotations;
using YWM.Dto;

namespace PLC.Interface.BaseUsers
{
    public class BaseUserDto : EntityDto
    {
        [Required(ErrorMessage = "用户名不能为空"), RegularExpression(@"^[a-zA-Z]{1,50}$", ErrorMessage = "用户名格式不正确")]
        public string Account { get; set; }

        [Required(ErrorMessage = "昵称不能为空"), StringLength(50, ErrorMessage = "昵称不能超过50个字符")]
        public string DisplayName { get; set; }

        [Required(ErrorMessage = "请选择性别"), Range(0, 1, ErrorMessage = "性别只能是男或女")]
        public byte? Sex { get; set; }

        [StringLength(100, ErrorMessage = "头像不能超过100个字符")]
        public string Photo { get; set; } = string.Empty;

        [Required(ErrorMessage = "请选择是否启用")]
        public bool? IsActive { get; set; }

        [StringLength(255, ErrorMessage = "描述不能超过255个字符")]
        public string Description { get; set; }
    }
}
